package com.yuanfeng.payment.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 交易订单表-强调唯一订单-充值则先创建充值订单
 *
 * @TableName pay_consume_trade_back
 */
@TableName("pay_consume_trade_back")
@Data
public class PayConsumeTradeBackEntity implements Serializable {

    /**
     * 商户订单id
     */
    @TableId
    private String orderId;

    /**
     * 交易订单id
     */
    private String consumeTradeId;

    /**
     * 买家id
     */
    private Integer buyerId;

    /**
     * 卖家id
     */
    private Integer sellerId;

    /**
     * 付款人id
     */
    private String payUserId;

    /**
     * 订单状态()
     */
    private Byte orderStateId;

    /**
     * 交易类型
     */
    private Boolean tradeTypeId;

    /**
     * 支付渠道
     */
    private Byte paymentChannelId;

    /**
     * 1:担保交易  2：直接交易
     */
    private Boolean tradeType;

    /**
     * 总付款额度 = trade_payment_amount + trade_payment_money + trade_payment_recharge_card + trade_payment_points
     */
    private BigDecimal orderPaymentAmount;

    /**
     * 实付金额，在线支付金额
     */
    private BigDecimal tradePaymentAmount;

    /**
     * 第三方支付金额
     */
    private BigDecimal tradeThirdPartyAmount;

    /**
     * 余额支付
     */
    private BigDecimal tradePaymentMoney;

    /**
     * 充值卡余额支付
     */
    private BigDecimal tradePaymentRechargeCard;

    /**
     * 积分支付
     */
    private BigDecimal tradePaymentPoints;

    /**
     * 折扣优惠
     */
    private BigDecimal tradeDiscount;

    /**
     * 佣金
     */
    private BigDecimal tradeCommisAmount;

    /**
     * 退还佣金
     */
    private BigDecimal tradeCommisRefund;

    /**
     * 订单退款
     */
    private BigDecimal tradeRefundAmount;

    /**
     * 总额虚拟的 = trade_order_amount + trade_discount
     */
    private BigDecimal tradeAmount;

    /**
     * 年-月-日
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date tradeDate;

    /**
     * 年
     */
    private Short tradeYear;

    /**
     * 月
     */
    private Byte tradeMonth;

    /**
     * 日
     */
    private Byte tradeDay;

    /**
     * 标题
     */
    private String tradeTitle;

    /**
     * 描述
     */
    private String tradeDesc;

    /**
     * 备注
     */
    private String tradeRemark;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date tradeCreateTime;

    /**
     * 付款时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date tradePayTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date tradeFinishTime;

    /**
     * 是否删除
     */
    private Boolean tradeDelete;

    /**
     * 满减活动中店铺承担的折扣金额
     */
    private Integer tradeShopBear;

    /**
     * 满减活动中平台承担的折扣金额
     */
    private Integer tradePlatformBear;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}